package common.domain;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author LinLe
 * @create 2020-12-26 9:29
 */
//对考题的封装
public class ExamQuestions implements Serializable {
    private static final long serialVersionUID = 6398786401325085633L;
    //题干
    private String question;
    //选项
    private String options;
    //答案
    private String answer;
    //分值
    private int value;
    
    public String getAnswer() {
        return answer;
    }
    
    public void setAnswer(String answer) {
        this.answer = answer;
    }
    
    private int number;
    
    public int getNumber() {
        return number;
    }
    
    public void setNumber(int number) {
        this.number = number;
    }
    
    public ExamQuestions() {
    }
    
    public ExamQuestions(String question, String options, int value,String answer) {
        this.question = question;
        this.options = options;
        this.value = value;
        this.answer = answer;
    }
    
    public String getQuestion() {
        return question;
    }
    
    public void setQuestion(String question) {
        this.question = question;
    }
    
    public String getOptions() {
        return options;
    }
    
    public void setOptions(String options) {
        this.options = options;
    }
    
    public int getValue() {
        return value;
    }
    
    public void setValue(int value) {
        this.value = value;
    }
    
    @Override
    public String toString() {
        return "ExamQuestions{" +
                "question='" + question + '\n' +
                ", answer='" + options + '\n' +
                ", value=" + value +", answer=" + answer +
                '}';
    }
    
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ExamQuestions that = (ExamQuestions) o;
        return Objects.equals(question, that.question) &&
                Objects.equals(options, that.options);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(question);
    }
}
